import request from '@/utils/request'

// 查询顾客信息列表
export function listCustomer(query) {
  return request({
    url: '/demo/customer/list',
    method: 'get',
    params: query
  })
}

// 查询顾客信息列表
export function getAllList(query) {
  return request({
    url: '/demo/customer/getAllList',
    method: 'get',
    params: query
  })
}

// 查询顾客信息详细
export function getCustomer(id) {
  return request({
    url: '/demo/customer/' + id,
    method: 'get'
  })
}

// 新增顾客信息
export function addCustomer(data) {
  return request({
    url: '/demo/customer',
    method: 'post',
    data: data
  })
}

// 修改顾客信息
export function updateCustomer(data) {
  return request({
    url: '/demo/customer',
    method: 'put',
    data: data
  })
}

// 删除顾客信息
export function delCustomer(id) {
  return request({
    url: '/demo/customer/' + id,
    method: 'delete'
  })
}

/* 获取临时凭证
get方法
参数{deptId:xxx}
返回tempToken */
export function generateCustomerQueryTemp(query) {
  return request({
    url: '/demo/customer/generateCustomerQueryTemp',
    method: 'get',
    params: query

  })
}

/* 绑定凭证
post方法
参数{code:xxx,tempToken:xxx}
返回绑定结果 */
export function bindCustomerQuery(data) {
  return request({
    url: '/demo/customer/bindCustomerQuery',
    method: 'post',
    data: data
  })
}

export function getCustomerByOpenId(query) {
  return request({
    url: '/demo/customer/getByOpenId',
    method: 'get',
    params: query

  })
}

export function getCustomerDesc(query) {
  return request({
    url: '/demo/customer/getCustomerDesc',
    method: 'get',
    params: query

  })
}


export function getCustomerDescOld(query) {
  return request({
    url: '/demo/customer/getCustomerDescOld',
    method: 'get',
    params: query

  })
}
